from apps import create_app
from flask_migrate import Migrate

from ext import db

# 导入模型
from apps.models.user import *
from apps.models.book import *
from apps.models.accessory import *

# 导入中间件
from apps.middlewares import AuthMiddleware

app = create_app()

# 加载中间件
app.wsgi_app = AuthMiddleware(app)

# 创建app与数据库映射
migrate = Migrate(app=app, db=db)


if __name__ == "__main__":
    app.run()
